namespace Expect.Documentation.Base_concepts
{
    using System;
    using Expect.Core;
    using Expect.Core.Fixtures;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    
    
    // This file is generated, if you modify content you will lose your modifications when the generator will regenerate the file
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Expect.Core", "0.5.2.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [TestClass()]
    [SpecificationContainerAttribute(Name="Fixture classes", Path="\\Base concepts\\Fixture classes.expect")]
    public partial class FixtureClassesContainer : Expect.Core.AbstractSpecificationContainer
    {
        
        partial void PrepareContextExtension();
        
        partial void BeforeInitExtension();
        
        partial void AfterInitExtension();
        
        partial void BeforeTeardownExtension();
        
        partial void AfterTeardownExtension();
        
#line 1 "Fixture classes.expect"
#line hidden
        
        public override void InitializeContext()
        {
            base.InitializeContext();
            PrepareContextExtension();
        }
        
        [TestInitialize()]
        public virtual void FixtureClassesClass_TestInit()
        {
            InitializeContext();
            BeforeInit();
            BeforeInitExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterInit();
            AfterInitExtension();
        }
        
        [TestCleanup()]
        public virtual void FixtureClassesClass_TestTeardown()
        {
            BeforeTeardown();
            BeforeTeardownExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterTeardown();
            AfterTeardownExtension();
        }
        
        // TestComment
        [TestMethod()]
        public virtual void FixtureClasses()
        {
            SpecificationDefinition spec = new SpecificationDefinition();
            Get_FixtureClasses(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }
        }
        
        [SpecificationProviderAttribute(Name="Fixture classes")]
        public virtual void Get_FixtureClasses(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "Fixture classes";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture<DescriptionFixture>();
#line 1
            fixture.WithRow("You could also write fixtures by writing classes. With fixture classes, Expect ma" +
                    "p a whole fixture on a class. The fixture class is responsible for the execution" +
                    " of all the rows in the fixture.");
#line 2
            fixture.WithRow("Expect define some fixture base classes that helps using common formats, like *Co" +
                    "lumnFixture* or *ActorFixture*. Those fixtures are explained in the \"Fixtures re" +
                    "ference\" chapter.");
#line 3
            fixture.WithRow("Once again, a small example will be better than a thousand words :");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 5
            fixture.WithRow("I forget my", "multiplication", "table for", "7", "");
#line 6
            fixture.WithRow("Value", "Result?");
#line 7
            fixture.WithRow("1", "7");
#line 8
            fixture.WithRow("2", "14");
#line 9
            fixture.WithRow("3", "21");
#line 10
            fixture.WithRow("4", "28");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 12
            fixture.WithRow("!In this case, the raw specification is :!");
#line 13
            fixture.WithRow("{{");
#line 14
            fixture.WithRow("I forget my |multiplication| table for |7|");
#line 15
            fixture.WithRow("Value  | Result?");
#line 16
            fixture.WithRow("     1 |      7");
#line 17
            fixture.WithRow("     2 |     14");
#line 18
            fixture.WithRow("     3 |     21");
#line 19
            fixture.WithRow("     4 |     28");
#line 20
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 22
            fixture.WithRow("To map a fixture on a class, expect try to find a class implementing *IFixtureImp" +
                    "lementation*, named as the first row of the fixture.");
#line 23
            fixture.WithRow("In our sample, Expect try to find a class named \"IForgetMyMultiplicationTableFor\"" +
                    ". The class inherit from ColumnFixture so it implements the interface through th" +
                    "e base class.");
#line 24
            fixture.WithRow("You could pass constructor parameters by separating them with pipes. In the sampl" +
                    "e, we pass the parameters \"multiplication\" and \"7\". It means that we could use t" +
                    "his same fixture for other specifications.");
#line 25
            fixture.WithRow("!For example :!");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 27
            fixture.WithRow("I forget my", "division", "table for", "9", "");
#line 28
            fixture.WithRow("Value", "Result?");
#line 29
            fixture.WithRow("9", "1");
#line 30
            fixture.WithRow("18", "2");
#line 31
            fixture.WithRow("27", "3");
#line 32
            fixture.WithRow("36", "4");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 34
            fixture.WithRow("This fixture is executed with the same class than the previous one, but with the " +
                    "parameters \"division\" and \"9\" instead of \"multiplication\" and \"7\".");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 36
            fixture.WithRow("You could also define multiple aliases on fixture classes by using *FixtureHintAt" +
                    "tribute* on your class to map a fixture class with different sentences. The foll" +
                    "owing fixture use the same class than the fixture above");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 37
            fixture.WithRow("I don\'t remember my", "division", "table for", "9", "");
#line 38
            fixture.WithRow("Value", "Result?");
#line 39
            fixture.WithRow("9", "1");
#line 40
            fixture.WithRow("18", "2");
#line 41
            fixture.WithRow("27", "3");
#line 42
            fixture.WithRow("36", "4");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 44
            fixture.WithRow("When resolving a fixture, fixture classes have priority over fixture methods.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 46
            fixture.WithRow("Fixture classes are very usefull for defining common data formats within you spec" +
                    "ification, or for reusing code between several specifications.");
#line hidden
            fixture.EndRun();

        }
    }
}
